home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
TURBOCU2.LZH
/
ECLIB.ARC
/
ECON.DOC
next >
Wrap
Text File
|
1987-07-15
|
8KB
|
167 lines
I haven't had time to write a fancy document on the routines so
I will just tell you what goes in, what they do, and what they return.
These routines support video modes 0 thru 7, updating the cursor
position after each output to the screen. The are considerably
faster than the routines available thru BIOS.
These routines have been well tested as far as CGA output goes,
except the snow control routines. These routines were designed after
what is used in fastwrit.c so snow should not be a problem. The
monocrome were routines were just desk checked, no hardware, but if
you have a problem, let me know I will upload a fix within a few days.
Any requests for features you'd like to see are more than welcome.
I will not be implementing windowing in these routines, thats reserved
for my next project.
These routines are available for any kind of use you desire to
put them to, no fee of any kind is expected or desired. They may be
used in comercial, shareware, or public domain software as desired.
For those who desire the source look for DL member ECSRC.ARC. If you
distribute these files, be prepared to support the users on the
bulliten board you post them on, or refer them here. If you use my
course in programs you distribute, I'd appreciate an acknowledgement.
Anything I forgot to say, just ask, I read most messages in section 11
of the board.
Joe Odenweller
compuserve id [76266,170]
------------------------------------------------------------------------
int ecattr(int attribute);
input:
attribute is an integer specifying the attribute to be used on
the current page. The attribute is used on all output to
the screen for the current page and mode.
return:
The routine returns the new attribute or EOF if the attribute is
invalid for the current mode.
purpose:
Use this routine to set the attribute to be used on all further
output to the screen. B&W modes will only accept 0x07, 0x70,
0x00, and 0x77. Color modes will accept any value. This value
is not currently used for mode 6.
------------------------------------------------------------------------
extern unsigned int ec_bufsz;
This variable expresses the largest output you can generate thru
ecprintf(). If set too small will cause overwriting portions
of the program. The default value is 255.
------------------------------------------------------------------------
extern unsigned char ec_dattr_cga;
This variable expresses the default attribute to be used on output
to the screen for CGA modes.
------------------------------------------------------------------------
extern unsigned char ec_dattr_mono;
This variable expresses the default attribute to be used on output
to the screen for Monocrome modes.
------------------------------------------------------------------------
int ecprintf(char *format, ...);
returns:
This returns the last character printed, zero if output is null,
or an EOF if an error occured with either allocation or
use of a temporary buffer allocated. If EOF is returned you
should probably end the program immediately.
purpose:
This acts like just like the cprintf routine with the following
differences. This routine is almost as fast as fastwrit.c.
The control chartacter \b causes a backspace, backspacing past
the beginning of the screen is not supported. \t causes a
forward jump to the next tab stop. \r causes a carraige return
without a line feed. \n causes a line feed without a carraige
return. \f causes the screen to be cleared and filled with the
current attribute, and the cursor reset to the upper left hand
corner. This routine will scroll down. This routine calls
ecputs() to do the actual output.
------------------------------------------------------------------------
int ecputc(char character);
returns:
This returns the last character printed, zero if output is null.
purpose:
This acts like just like the cputc routine with the following
differences. This routine is almost as fast as fastwrit.c.
The control chartacter \b causes a backspace, backspacing past
the beginning of the screen is not supported. \t causes a
forward jump to the next tab stop. \r causes a carraige return
without a line feed. \n causes a line feed without a carraige
return. \f causes the screen to be cleared and filled with the
current attribute, and the cursor reset to the upper left hand
corner. This routine will scroll down. This routine calls
ecputs() to do the actual output.
------------------------------------------------------------------------
int ecputs(char *string);
returns:
This returns the last character printed, zero if output is null.
purpose:
This acts like just like the cputs routine with the following
differences. This routine is almost as fast as fastwrit.c.
The control chartacter \b causes a backspace, backspacing past
the beginning of the screen is not supported. \t causes a
forward jump to the next tab stop. \r causes a carraige return
without a line feed. \n causes a line feed without a carraige
return. \f causes the screen to be cleared and filled with the
current attribute, and the cursor reset to the upper left hand
corner. This routine will scroll down.
------------------------------------------------------------------------
int ecseek(int page, long offset, int fromwhere);
input:
page is the page to make active.
offset is an encoded variable containing the row and column
changes. Negatives are valid. See MK_CS.
fromwhere defines how offset is to be used in positioning the
cursor. Possible values are SEEK_SET which takes the row
and column as the absolute position, SEEK_CUR specifies to
add the offset to the current position, and SEEK_END says to
add the offset to the value for the end of screen (row = 25,
col = 0).
returns:
This returns EOF the page is invalid, zero otherwise.
purpose:
To position the cursor on the screen. Positioning off the screen
will cause the appropriate amount of scrolling in the up or down
direction. Do not use this to clear the screen, ecprintf("\f");
is much faster.
------------------------------------------------------------------------
long ectell(int page);
input:
page is the page to be examined.
returns:
The encoded cursor address. See CS_ROW and CS_COL.
purpose:
To determine current position on the screen.
------------------------------------------------------------------------
int CS_ROW(long offset); /* MACRO */
input:
offset as generated by MK_CS() or ectell();
returns:
The row contained in the offset.
purpose:
To determine row contained in the long returned by ectell();
------------------------------------------------------------------------
int CS_COL(long offset); /* MACRO */
input:
offset as generated by MK_CS() or ectell();
returns:
The column contained in the offset.
purpose:
To determine column contained in the long returned by ectell();
------------------------------------------------------------------------
int MK_CS(int row, int column); /* MACRO */
input:
row and column to be inserted into the offset.
returns:
The offset used by ecseek().
purpose:
To construct the offset parameter used by ecseek().